import { AxiosPromise } from 'axios';
import request from '@/utils/request';

export function entryGetList(): AxiosPromise<any[]> {
  return request({
    url: '/wiki/entry/getList',
    method: 'get'
  });
}

export function entryList(query: any): AxiosPromise<any[]> {
  return request({
    url: '/wiki/entry/list',
    method: 'get',
    params: query
  });
}

export function entryDetail(id: string): AxiosPromise<any> {
  return request({
    url: '/wiki/entry/' + id,
    method: 'get'
  });
}

export function saveEntry(data: any): AxiosPromise<any> {
  return request({
    url: '/wiki/entry',
    method: 'post',
    data
  });
}

export function updateEntry(data: any): AxiosPromise<any> {
  return request({
    url: '/wiki/entry',
    method: 'put',
    data
  });
}

export function deleteEntry(id: string): AxiosPromise<any> {
  return request({
    url: '/wiki/entry/' + id,
    method: 'delete'
  });
}
